package com.it9.taotao.manager.controller;

import com.google.common.base.Strings;
import com.it9.taotao.base.VO.ItemCatResponse;
import com.it9.taotao.manager.service.IItemCatService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ItemCatController {

    @Autowired
    private IItemCatService itemCatService;

    @PostMapping("/item/cat/list")
    @ResponseBody
    public List<ItemCatResponse> listItemCat(@RequestParam(required = false, defaultValue = "0") String id) {

        return itemCatService.listItemCatByParentId(id);
    }
}
